
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-9">
            <div class="tabs-container">
                <ul class="nav nav-tabs" id="tab-list-2">
                    <li class="links active" id="search-link"><a href="#search" role="tab" data-toggle="tab">Search</a></li>
                </ul>
                <div class="tab-content">
                   <div id="search" class="tab-pane active">
                        <div class="panel-body">
                             
                                  <div class="ibox-title" style="border:none;"><h5 style="color: #00afef"><i>Plumber Reading Performance</i></h5>
                                  </div>
                                     <div class="ibox-content">
                                       <form class="form-horizontal" id="payment_process_form">
                                          <div>
                                            <label class="col-lg-2 control-label">Date</label>
                                              <div class="col-lg-5">
                                                <input type="date" id="rDate" value="" class="form-control">
                                              </div>
                                            </div>
                                          <div>
                                        </form>
                                          <a  id="getRes" class="btn btn-sm btn-primary save-btn-tab">Get Result</a>
                                        </div>
                                      </br>
                                         <table style="width:100%;align:center;" class="table-bordered table-compact" id="reports">
                                          <thead>
                                            <tr>
                                              <th>User Name</th>
                                              <th>First Name</th>
                                              <th>Last Name</th>
                                              <th>Count</th>
                                            </tr>
                                          </thead>
                                          <tbody id="tbod_au">
                                           
                                          </tbody>
                                        </table>
                                      </div>
                                 
                          
                            
                              
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div><!-- END of class row-->
</div>
 <script type="text/javascript">
  $(document).ready(function(){


    $(".chosen-select").chosen({width:"100%;"});
    $('#getRes').click(function(){
      $.ajax({
          url:"<?php echo base_url($this->session->userdata('forajax').'/search_prog'); ?>",
          type:"POST",
          data:{'date': $('#rDate').val()},
          dataType:'json',
          success: function(data){
            if(data.length == 0){
              console.log('wala');
            }else{
              var trHTML=''
              $.each(data,function(i,item){
                 // var links = '<button class="btn btn-link" style=" padding: 0px;" id="'+data[i].num+'">'+data[i].a_count ]+'</button>';
                 trHTML += '<tr>'+
                 '<td align="center" style="text-align:center; padding:2px;">'+data[i].user_name+'</td>'+
                 '<td align="center" style="text-align:center; padding:2px;">'+data[i].first_name+'</td>'+
                 '<td align="center" style="text-align:center; padding:2px;">'+data[i].last_name+'</td>'+
                 '<td align="center" style="text-align:center; padding:2px;">'+data[i].count+'</td>';
                });
            }

            $('#tbod_au').html(trHTML);

          }
      });
    });
      // $(document).on('click','.open_arear',function(){
      //     var cnt =$(this).attr('id');
      //     var zone =$(this).closest('tr').find('#z1').val();
      //      console.log(zone+'-'+cnt); 
      //     var title = 'Arrear List';
      //     var url = '<?php echo base_url($this->session->userdata('forajax')); ?>/get_pend?id='+cnt+'&zone='+zone;
      //     window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no');
      //   });

  });
 </script>